package com.tanhua.admin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tanhua.model.domain.Analysis;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;

/**
 * @author Xiao
 * @version 1.0
 * @description
 * @date 2021/11/5
 */
@Mapper
public interface AnalysisMapper extends BaseMapper<Analysis> {
    /**
     * 查询制定日期之后的活跃用户数量
     * @param date
     * @return
     */
    @Select("SELECT SUM(num_active) FROM tb_analysis_by_day " +
            "WHERE record_date >= #{date} AND record_date < #{today}")
    Integer getActivePassDate(@Param("date") Date date, @Param("today") Date today);
}
